package com.apes.scm.masterdata.statistics.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.audit.Auditing;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name =MenuStatistics.CONST_TABLE_NAME)
public class MenuStatistics extends Model {
    public static final String CONST_TABLE_NAME = "menu_statistics";

    @Id
    @Column(name = "id", length = 10)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "菜单使用统计")
    @Comment("编码")
    private String id;

    @Column(name = "user_id", length = 10)
    @Comment("访问人员ID")
    private String userId;

    @Column(name = "user_name", length = 10)
    @Comment("访问人员ID")
    private String userName;

    @Column(name = "menu_id", length = 16)
    @Comment("菜单ID")
    private String menuId;

    @Column(name = "menu_name", length = 64)
    @Comment("菜单名称")
    private String menuName;

    @Column(name = "formId", length = 128)
    @Comment("菜单访问地址")
    private String formId;

    @Column(name = "source_menu_id", length = 16)
    @Comment("来源菜单ID")
    private String sourceMenuId;

    @Column(name = "source_menu_name", length = 64)
    @Comment("来源菜单名称")
    private String sourceMenuName;

    @Column(name = "type", length = 16)
    @Comment("类型") // type : search 搜索框入口 | common 常用 | assembly 组合 | menu 菜单入口 | link 详情 | todo 待办入口
    private String type;


}
